<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-20 11:33:17
 * @LastEditTime: 2019-08-30 14:42:10
 * @LastEditors: Please set LastEditors
 -->
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
	{namespace chart=Jykj\Echarts\ViewHelpers}
	<f:layout name="Default" />

	This Template is responsible for creating a table of domain objects.

	If you modify this template, do not forget to change the overwrite settings
	in /Configuration/ExtensionBuilder/settings.yaml:
	Resources:
	Private: 
	Templates:
	List.html: keep

	Otherwise your changes will be overwritten the next time you save the extension in the extension builder

	<f:section name="content">
		<f:flashMessages />
		<div class="portlet light ">
			<div class="portlet-title">
				<div class="caption">
					<f:link.action action="new" class="btn btn-info">新增</f:link.action>
				</div>
				<div class="actions">
					<div class="btn-group btn-group-devided">
						<f:form action="list" name="echart" class="form-inline" method="GET">
							<div class="input-group">
								<f:form.select class="form-control" name="echart" options="{charts}" optionValueField="key"
									optionLabelField="value" prependOptionLabel="--类型--" value="{echart}" />
							</div>
							<div class="input-group">
								<div class="input-icon">
									<input type="hidden" name="id" value="{pageUid}" />
									<f:form.hidden name="action" value="list" />
									<i class="fa fa-search"></i>
									<f:form.textfield name="keyword" value="{keyword}" class="form-control"
										placeholder="请输入查询条件" />
								</div>
								<span class="input-group-btn">
									<f:form.submit class="btn btn-success" value="搜" />
								</span>
							</div>
						</f:form>
					</div>
				</div>
			</div>

			<f:widget.paginate objects="{echarts}" as="echartsItems" configuration="{settings.paginate}">
				<div class="portlet-body">
					<div class="table-scrollable">
						<table class="table table-hover table-light">
							<thead>
								<tr class="uppercase">
									<th></th>
									<th>序号</th>
									<th>名称</th>
									<th>类型</th>
									<th>主题</th>
									<th>创建人</th>
									<th>添加时间</th>
									<th>更新时间</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<f:for each="{echartsItems}" as="echart" iteration="item">
									<tr>
										<td>
											<label class="mt-checkbox mt-checkbox-outline">
												<input type="checkbox" value="{echart.uid}" name="test" class="normal sel" />
												<span></span>
											</label>
										</td>
										<td>
											{f:cObject(typoscriptObjectPath:'lib.calc',
											data:'{item.cycle}+({page}-1)*{settings.paginate.itemsPerPage}')}
										</td>
										<td>{echart.title}</td>
										<td>
											<f:switch expression="{echart.echart}">
												<f:case value="bar">柱状图</f:case>
												<f:case value="line">折线图</f:case>
												<f:case value="pie">饼状图</f:case>
												<f:case value="pyramid">金字塔图</f:case>
												<f:case value="funnel">漏斗图</f:case>
												<f:defaultCase>--</f:defaultCase>
											</f:switch>
										</td>
										<td>{echart.listtheme}</td>
										<td>{echart.author}</td>
										<td>{echart.crdate -> f:format.date(format:'Y-m-d H:i')}</td>
										<td>{echart.tstamp -> f:format.date(format:'Y-m-d H:i')}</td>
										<td>
											<f:link.action action="chart" arguments="{echarts : echart}"
												class="btn btn-info btn-xs">编辑</f:link.action>
											<!-- <f:link.action action="chart" arguments="{echarts : echart}"
												class="btn btn-default btn-xs">数据</f:link.action> -->
											<a href="#modalBox{echart.uid}" data-toggle="modal"
												data-target="#modalBox{echart.uid}"
												class="btn btn-success btn-xs">预览</a>
											<f:link.action action="delete" arguments="{echarts : echart}"
												class="btn btn-danger btn-del btn-xs">删除
											</f:link.action>
										</td>
									</tr>
									<f:format.raw>{chart:getExample(echarts:echart)}</f:format.raw>
								</f:for>
								<tr>
									<td>
										<label class="mt-checkbox mt-checkbox-outline">
											<input type="checkbox" name="test" class="normal selectall" />
											<span></span>
										</label>
									</td>
									<td colspan="9">
										<f:form action="multidelete" name="datas">
											<f:form.hidden id="multidelete-items" property="items" value="" />
											<f:form.submit value="删除选中" class="btn btn-danger btn-xs delete btn-delete-all" />
										</f:form>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</f:widget.paginate>
		</div>
	</f:section>

</html>